package cn.fan.redis;


import cn.fan.pojo.MyMail;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;

@Component
public class MSGRedis {
    private static final String SENDMAIL = "msg:sendmail";

    @Cacheable(value = SENDMAIL,key = "#id")
    public MyMail getMail(long id){
        return null;
    }

    @CachePut(value = SENDMAIL,key = "#id")
    public MyMail putMail(long id,MyMail myMail){ return myMail;}

    @CacheEvict(value = SENDMAIL,key = "#id")
    public  void delete(long id){}
}
